package collection;

import java.util.ArrayList;
import java.util.Collection;

/**
 * @Author: Miyako
 * @Date: 2024-07-13-15:12
 * @Description: 增强型for循环，遍历集合或数组
 * for(元素类型 变量名 ：集合或数组）
 */
public class NewFoeDemo {
    public static void main(String[] args) {

        String [] arr = {"1","2","3","4"};
        for (String x : arr){
            System.out.println(x);
        }
        Collection<String> s = new ArrayList<>();
        s.add("ll");
        s.add("ee");
        s.add("aa");
        for (String a : s ){
            System.out.println(a);
        }

    }
}
